package org.skyer.third.gateway.api.feign;

import io.swagger.annotations.ApiOperation;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.skyer.third.gateway.api.dto.LogisticsTrajectoryRequestDTO;
import org.skyer.third.gateway.api.dto.QueryLogisticsNoRequestDTO;
import org.skyer.third.gateway.api.dto.SpecifyOrderSnDTO;
import org.skyer.third.gateway.api.vo.LogisticsTrajectoryResponseVO;
import org.skyer.third.gateway.api.vo.QueryLogisticsNoResponseVO;

import javax.validation.Valid;


@FeignClient(
        value = ILogisticsInfoClient.APP_NAME
)
public interface ILogisticsInfoClient {

    String APP_NAME = "skyer-third-gateway";

    String API_PREFIX = "/client";

    String LOGIS_TRA = API_PREFIX + "/queryLogisticsTrajectory";

    String LOGIS_NO = API_PREFIX + "/queryLogisticsNo";


    String SPECIFY_ORDER_SN_SYNC = API_PREFIX + "/specifyOrderSnSync";

    /**
     * 获取物流轨迹
     *
     * @param request 业务参数
     * @return 结果
     */
    @ApiOperation(value = "获取物流轨迹")
    @PostMapping(LOGIS_TRA)
    R<LogisticsTrajectoryResponseVO> queryLogisticsTrajectory(@Valid @RequestBody LogisticsTrajectoryRequestDTO request);

    /**
     * 获取物流单号
     * @param req
     * @return
     */
    @ApiOperation(value = "获取物流单号")
    @PostMapping(LOGIS_NO)
    R<QueryLogisticsNoResponseVO> queryLogisticsNo(@RequestBody QueryLogisticsNoRequestDTO req);



    /**
     * 指定订单同步
     * @param specifyOrderSnDTO
     * @return
     */
    @ApiOperation(value = "指定订单同步")
    @PostMapping(SPECIFY_ORDER_SN_SYNC)
    R specifyOrderSnSync(@RequestBody SpecifyOrderSnDTO specifyOrderSnDTO);
}
